#ifndef PLAN_GENERATOR_H
#define PLAN_GENERATOR_H

#include "ast.h"
#include "catalog.h"
#include "plan.h" // 包含plan.h而不是重复定义

// 创建表计划数据
typedef struct {
    TableSchema* table_schema;
} CreateTablePlan;

// 插入计划数据
typedef struct {
    char* table_name;
    char** columns;
    int column_count;
    ASTNode** values;
    int value_count;
} InsertPlan;

// 顺序扫描计划数据
typedef struct {
    char* table_name;
} SeqScanPlan;

// 过滤计划数据
typedef struct {
    ASTNode* condition;
} FilterPlan;

// 投影计划数据
typedef struct {
    ASTNode** columns;
    int column_count;
} ProjectPlan;

// 生成执行计划
PlanNode* generate_plan(ASTNode* ast, Catalog* catalog);
#endif // PLAN_GENERATOR_H